#include <iostream>

using namespace std;

const int N = 2010;

string s, t;
int n, m, pi[N];

int main()
{
	while(cin >> s >> t)
	{		
		n = s.size(); m = t.size();
		s = ' ' + t + ' ' + s;
		
		for(int i = 2; i <= n + m + 1; i++)
		{
			int j = pi[i - 1];
			while(j && s[i] != s[j + 1]) j = pi[j];
			if(s[i] == s[j + 1]) j++;
			pi[i] = j;
		} 
		
		int ret = 0;
		for(int i = m + 1; i <= n + m + 1; i++)
		{
			if(pi[i] == m) 
			{
				ret++;
				i += m - 1;
			}
		}
		
		cout << ret << endl;
	}
	
	return 0;
}














